package com.example.pm.ending.server.service.impl;

import com.example.pm.ending.server.ex.ServiceException;
import com.example.pm.ending.server.mapper.AdminMapper;
import com.example.pm.ending.server.mapper.AdminRoleRelMapper;
import com.example.pm.ending.server.mapper.PublishAdminMapper;
import com.example.pm.ending.server.mapper.RoleMapper;
import com.example.pm.ending.server.module.admin.AddNewAdminEntityDTO;
import com.example.pm.ending.server.module.admin.AdminListEntityVO;
import com.example.pm.ending.server.module.admin.UpdateAdminEntityDTO;
import com.example.pm.ending.server.pojo.entity.Admin;
import com.example.pm.ending.server.pojo.entity.AdminRoleRel;
import com.example.pm.ending.server.pojo.vo.AdminStandardVO;
import com.example.pm.ending.server.pojo.vo.RoleListVO;
import com.example.pm.ending.server.service.IAdminModuleService;
import com.example.pm.ending.server.service.IRoleModuleService;
import com.example.pm.ending.server.web.ServiceCode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.Iterator;
import java.util.List;

@Service
@Slf4j
public class RoleModuleServiceImpl implements IRoleModuleService {


    @Autowired
    private RoleMapper roleMapper;

    @Override
    public List<RoleListVO> list() {
        log.debug("开始处理【查询角色列表】的业务，无参数");
        List<RoleListVO> list = roleMapper.list();
        Iterator<RoleListVO> iterator = list.iterator();
        while (iterator.hasNext()) {
            RoleListVO roleListItemVO = iterator.next();
            if (roleListItemVO.getId() == 1) {
                iterator.remove();
                break;
            }
        }
        return list;
    }
}
